<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Ajaxquery extends Controller
{
    public function action_getimages()
    {
        $images = ORM::factory('Mgallery')->get_images(
        	$this->request->post('offset'),
            $this->request->post('limit')
            );

        foreach($images as $image)
        {
		    echo HTML::anchor(
                'uploads/'.$image->name_image,
                HTML::image(
                    './uploads/200x150_'.$image->name_image, 
                    array(
                        'alt' => $image->description_image, 
                        'title' => $image->description_image)),
                array('title' => $image->description_image,
                    'id' => 'img_a_'.$image->id_image
                )
            ); 
        }
    }
}